package Thread;

/**
 * Created with IntelliJ IDEA.
 * Description: 多线程实现使用方法二：实现Runnable接口，实例化作为任务传递给Thread
 */
class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("hello");
    }
}

public class ThreadDemo2 {
    public static void main(String[] args) {
        Runnable runnable = new MyRunnable();
        Thread thread = new Thread(runnable);
        thread.start();
    }
}
